impl Solution {
  pub fn max_power(s: String) -> i32 {
      let mut count: i32 = 0;
      let mut max: i32 = 0;
      let mut now: char = '1';
      for c in s.chars() {
          if c == now {
              count = count + 1;
          }
          else {
              if count >= max {
                  max = count;
              }
              now = c;
              count = 1;
          }
      }
      return if max > count { max } else { count };
  }
}